package com.fy.service.server;
import com.fy.service.server.channel.SocketServerHelper;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Slf4j
@EnableDiscoveryClient
@SpringBootApplication
@MapperScan({"com.fy.dao.mapper"})
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
public class ImServerApplication implements CommandLineRunner {
    @Autowired
    private SocketServerHelper socketServerHelper;

    public static void main(String[] args) {
        log.debug("--->start ImServerApplicationStart ");
        SpringApplication.run(ImServerApplication.class, args);
        log.debug("--->start ImServerApplicationStart success");
    }

    @Override
    public void run(String... args) throws Exception {
        socketServerHelper.startSocketServer();
        socketServerHelper.startWebsocketServer();
    }
}
